package jspservlet.servlet;

import java.io.IOException;
//import java.io.PrintWriter;
import java.util.ArrayList;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import jspservlet.dao.DeviceDAO;
import jspservlet.dao.impl.DeviceDAOImpl;
import jspservlet.vo.Door;
import jspservlet.vo.Connection;

public class ChangeDoorStateServlet {

    public void doGet(HttpServletRequest req,HttpServletResponse res) 
		throws IOException,ServletException{
	}

	public void doPost(HttpServletRequest req,HttpServletResponse res) 
			throws IOException,ServletException{
        DeviceDAO dao = new DeviceDAOImpl();
        Door door = new Door();
        int order = Integer.parseInt(req.getParameter("Ison"));
        //判断开门还是关门
        if(order == 1){
            //开门前端
        }else{
            //关门前端
        }
        door.setIson(order); 
        //输入设备id
        try {
            int flag = dao.changeDoorstate(door);
        } catch (Exception e) {
            e.printStackTrace();
        } 

    }
}
    

